%
% Copyright (c) 2016-2019 Petr Gotthard <petr.gotthard@centrum.cz>
% All rights reserved.
% Distributed under the terms of the MIT License. See the LICENSE file.
%
{application, lorawan_server,
    [{description, "LoRaWAN Application Server"},
    {vsn, "0.7.0"},
    {modules, []},
    {registered, []},
    {mod, {lorawan_app, []}},
    {env, [
        {applications, [
            {<<"semtech-mote">>, lorawan_application_semtech_mote}
        ]},
        {connectors, [
            {lorawan_connector_amqp, [<<"amqp">>, <<"amqps">>]},
            {lorawan_connector_mqtt, [<<"mqtt">>, <<"mqtts">>]},
            {lorawan_connector_http, [<<"http">>, <<"https">>]},
            {lorawan_connector_mongodb, [<<"mongodb">>]},
            {lorawan_connector_ws, [<<"ws">>]}
        ]},
        {packet_forwarder_listen, [{port, 1680}]},
        {http_admin_path, <<"/admin">>},
        {http_admin_listen, [{port, 8080}]},
        {http_admin_redirect_ssl, true},
        {http_admin_credentials, {<<"admin">>, <<"admin">>}},
        {http_extra_headers, #{}},
        % use to limit SSL versions and ciphers, see http://erlang.org/doc/man/ssl.html
        {ssl_options, []},
        {map_tile_server, <<"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png">>},
        {frames_before_adr, 50},
        {retained_rxframes, 50},
        {websocket_timeout, 3600000}, % ms
        % {sec, fcnt} after which the device status should be request
        % by default: 5 days or 4*24 frames
        {devstat_gap, {432000, 96}},
        {max_lost_after_reset, 10},
        % packet_forwarder's push_timeout_ms + network delay
        {gateway_delay, 200},
        {deduplication_delay, 200},
        {server_stats_interval, 60}, % [s]
        {slack_server, {"slack.com", 443}},
        {trim_interval, 3600}, % [s]
        {event_lifetime, 86400}
    ]},
    {applications, [kernel, stdlib, sasl, os_mon, lager, mnesia, eid, cbor,
        cowboy, gun, jsx, iso8601, gen_smtp, amqp_client, emqtt, erlmongo,
        prometheus_cowboy]}]}.

% end of file
